package src.F_CollectionFramework;

import java.io.FileInputStream;
import java.util.Properties;

public class F01_Properties {
    public static void main(String[] args) {
        try {
            FileInputStream fis = new FileInputStream("src\\F_CollectionFramework\\a.properties");
            Properties properties = new Properties();
            properties.load(fis); // 加载流中的文件的数据
            String name = properties.getProperty("name"); // 利用key拿value
            String age = properties.getProperty("age");
            System.out.println(name+" "+age);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
